﻿<phone:PhoneApplicationPage
    x:Name="Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:viewmodel="clr-namespace:TakePhotoTogether"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=MediaViewer"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    x:Class="TakePhotoTogether.GalleryPage"
    xmlns:view="clr-namespace:TakePhotoTogether.View"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Landscape"
    Loaded="PhoneApplicationPage_Loaded"
    shell:SystemTray.IsVisible="False">


    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    
    
    <phone:PhoneApplicationPage.Resources>
        <Storyboard x:Name="AppBarFadeOutStoryboard">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="AppBarOpacity" Storyboard.TargetName="Page">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.99"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="{StaticResource AppBarSemitransparentOpacity}"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="AppBarFadeInStoryboard">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="AppBarOpacity" Storyboard.TargetName="Page">
                <EasingDoubleKeyFrame KeyTime="0" Value="{StaticResource AppBarSemitransparentOpacity}"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.99"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </phone:PhoneApplicationPage.Resources>
    
    <Grid x:Name="LayoutRoot" Background="Black">
        <Image x:Name="EmptyImage"  Source="/Assets/PlaceHolderEmptyGallery.png" Stretch="Uniform" Visibility="{Binding PlaceHolderVisibility}" />
        <controls:MediaViewer
              x:Name="MediaViewer"
              Items="{Binding CameraRoll}" 
              FooterVisibility="Visible"
              FooterDisplayed="MediaViewer_FooterDisplayed"
              ItemDisplayed="MediaViewer_ItemDisplayed"
              ItemZoomed="MediaViewer_ItemZoomed"
              ItemUnzoomed="MediaViewer_ItemUnzoomed"
              InitiallyDisplayedElement="Last">
            <controls:MediaViewer.FooterTemplate>
                <DataTemplate>
                    <Grid x:Name="LivePreviewTapTarget" Background="Transparent">
                        <Grid.Resources>
                            <Storyboard x:Name="ReviewImageSlideOff">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="ReviewImage">
                                    <EasingDoubleKeyFrame x:Name="ReviewImageSlideOffTranslateStart" KeyTime="0" Value="0"/>
                                    <EasingDoubleKeyFrame x:Name="ReviewImageSlideOffTranslateEnd" KeyTime="0:0:0.300" Value="-800"/>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Grid.Resources>
                    </Grid>
                </DataTemplate>
            </controls:MediaViewer.FooterTemplate>
        </controls:MediaViewer>
        
        <view:FTU
            x:Name="FTU" 
            Loaded="FTU_Loaded"
            Visibility="Collapsed"
            Width="Auto" Height="Auto" />
    </Grid>
</phone:PhoneApplicationPage>